<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript的消息框</title>
</head>
<body>

<script>
    function UIfunction() {
        alert("你好，\n我是一个消息框");
    }
</script>

<input type="button" onclick="UIfunction()" value="显示警告框"/>

</body>
</html>